package com.yonyou.train.web;

import com.yonyou.train.ResultJson;
import com.yonyou.train.StatusCode;
import com.yonyou.train.model.Auth;
import com.yonyou.train.service.CourseService;
//import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.sql.Connection;
import java.util.LinkedList;


/**
 * 查看我的课程
 */
@RestController
@RequestMapping(value = "/course",method = RequestMethod.GET)
public class CourseController {
    @Autowired
    private CourseService courseService;
    //获取课程考勤情况
    /*type=0-------全部课程
    type=1-------已签到
    type=2-------已请假
    type=3-------未签到*/
   //分页效果
 @RequestMapping(value = "/getcourse")
    public Object getAllCourse(@RequestParam(value = "pagesize") Integer pagesize,
                               @RequestParam(value = "pageindex") Integer pageindex,
                               @RequestParam(value = "type") Integer type, HttpServletRequest request) {
        return ResultJson.success(StatusCode.SUCCESS,"success",  courseService.findAllCourse(pagesize,pageindex,type,request));
    }

}
